package com.bltec.emergency.service.foreignService.impl;

import com.bltec.emergency.mapper.ForeignMainMapper;
import com.bltec.emergency.model.ForeignMain;
import com.bltec.emergency.service.foreignService.ForeignMainService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class ForeignMainServiceImpl implements ForeignMainService {
    @Resource
    private ForeignMainMapper foreignMainMapper;
    @Override
    public boolean add(ForeignMain foreignMain) {
        return foreignMainMapper.insert(foreignMain);
    }

    @Override
    public boolean deleteForeignById(Long id) {
        return foreignMainMapper.setDisableById(id);
    }

    @Override
    public boolean updateForeignById(ForeignMain foreignMain) {
        return foreignMainMapper.updateForeignById(foreignMain);
    }

    @Override
    public ForeignMain getForeignById(Long id) {
        return foreignMainMapper.getForeignById(id);
    }

    @Override
    public List<ForeignMain> getAll() {
        return foreignMainMapper.selectAll();
    }
}
